<template>
    <div class="detail-wrapper">
      <el-dialog
        title="毛重作废详情"
        class="tableDialog"
        :visible.sync="detailVisible">
        <div class="detail">
          <table class="detail-table" cellspacing="0" cellpadding="0">
            <tr>
              <td class="table-title">作废时间</td>
              <td class="table-content">{{this.viewForm.createDate}}</td>
              <td class="table-title">作废人</td>
              <td class="table-content"><span v-if="viewForm.createBy !== undefined">{{this.viewForm.createBy.loginName}}</span></td>
            </tr>
            <tr>
              <td class="table-title">作废原因</td>
              <td class="table-content" colspan="3">{{this.viewForm.operateReason}}</td>
              <!--            <td class="table-title"></td>-->
              <!--            <td class="table-content"></td>-->
            </tr>
            <!--          <tr>-->
            <!--            <td class="table-title">状态</td>-->
            <!--            <td class="table-content">-->
            <!--              {{$dictUtils.getDictLabel("weightOperateState", this.viewForm.operateState, "")}}-->
            <!--            </td>-->
            <!--            <td class="table-title"></td>-->
            <!--            <td class="table-content"></td>-->
            <!--          </tr>-->
            <!--          <tr>-->
            <!--            <td class="table-title">作废数据详情</td>-->
            <!--            <td class="table-content" colspan="3"></td>-->
            <!--            <td class="table-title"></td>-->
            <!--            <td class="table-content"></td>-->
            <!--          </tr>-->
            <tr>
              <td class="table-title">过磅单号</td>
              <td class="table-content"><span v-if="viewForm.weight!==undefined">{{this.viewForm.weight.weightCode}}</span></td>
              <td class="table-title">车牌号</td>
              <td class="table-content"><span v-if="viewForm.transport!==undefined">{{this.viewForm.transport.truckNumber}}</span></td>
            </tr>
            <tr>
              <td class="table-title">客户名称</td>
              <td class="table-content"><span v-if="viewForm.business!==undefined">{{this.viewForm.business.companyName}}</span></td>
              <td class="table-title">车辆识别</td>
              <td class="table-content"></td>
            </tr>
            <tr>
              <td class="table-title">货物名称</td>
              <td class="table-content"><span v-if="viewForm.product!==undefined">{{this.viewForm.product.name}}</span></td>
              <td class="table-title">磁卡卡面号</td>
              <td class="table-content"><span v-if="viewForm.card!==undefined">{{this.viewForm.card.cardNumber}}</span></td>
            </tr>
            <tr>
              <td class="table-title">毛重磅房</td>
              <td class="table-content"><span v-if="viewForm.grossRoom!==undefined">{{this.viewForm.grossRoom.name}}</span></td>
              <td class="table-title">设备编号</td>
              <td class="table-content"><span v-if="viewForm.grossEquip!==undefined">{{this.viewForm.grossEquip.outerCode}}</span></td>
            </tr>
            <tr>
              <td class="table-title">毛重时间</td>
              <td class="table-content"><span v-if="viewForm.gross!==undefined">{{this.viewForm.gross.weightTime}}</span></td>
              <td class="table-title">毛重</td>
              <td class="table-content"><span v-if="viewForm.gross!==undefined">{{this.viewForm.gross.weightMeasured}}</span></td>
            </tr>
            <tr>
              <td class="table-title">毛重(调整)</td>
              <td class="table-content"><span v-if="viewForm.weight!==undefined">{{this.viewForm.weight.weightGross}}</span></td>
              <td class="table-title"></td>
              <td class="table-content"></td>
            </tr>
          </table>
        </div>
      </el-dialog>
    </div>
</template>

<script>
    import {getById} from '@/api/warehouse/change/WarehouseChange.js';
    export default {
      name: 'details',
      data () {
        return {
          detailVisible: false,
          truckNumber: '',
          viewForm: {
            codes:'',
            dates:'',
            wtype:'',
            showPro:'',
            warehouseName:'',
            quatity:'',
            approvalState:''
          }
        }
      },
      methods: {
        init (method, row) {
          if (method === 'detail') {
            this.detailVisible = true
            this.$http({
              url: `/weight/exceptionQuery/queryById?id=${row.id}`,
              method: 'get'
            }).then(({data}) => {
              this.viewForm = data.result
              this.inputForm = this.recover(this.inputForm, data.result)
              this.loading = false
            })
          }
        }
      }
    }
</script>

<style lang="scss" scoped>
  .detail-wrapper{
    ::v-deep.el-dialog{
      .el-dialog__body{
        .title{
          margin-bottom: 10px;
        }
        .detail-table{
          border: 1px solid #DDDDDD;
          border-bottom: none;
          td{
            padding: 12px 10px;
            border-right: 1px solid #DDDDDD;
            border-bottom: 1px solid #DDDDDD;
          }
          .table-title{
            width: 125px;
            font-size: 14px;
            font-family: Microsoft YaHei;
            font-weight: 400;
            color: #999999;
          }
          .table-content{
            width: 260px;
            font-size: 14px;
            font-family: Microsoft YaHei;
            font-weight: 400;
            color: #333333;

            span:first-child{
              margin-right: 20px;
            }
          }
        }
      }
    }

  }
</style>
